<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>更改头像 - <?php echo $cfg_webname; ?></title>
<link href="templets/style/css/reset.css" rel="stylesheet" type="text/css">
<link href="templets/style/css/member.css" rel="stylesheet" type="text/css">
<script src="<?php echo $cfg_skin;?>/js/jquery-1.7-min.js" type="text/javascript"></script> 
<!-- up-face -->
<script type="text/javascript" src="upface/ajaxupload.3.5.js"></script>
</head>
<body>

<!--head-->
<?php include(DEDEMEMBER. "/templets/head.htm"); ?>

<div class="main">

<?php include(DEDEMEMBER."/templets/menu.php"); ?> 
<script>
	$(function(){
		var ids = $('#8');
		var span  = ids.find('.icons');
		var name = span.attr('class');
		var newName = name.replace(/(\S+)$/,'$1_h');
		span.addClass(newName);
		span.parent('a').addClass('cur');
	})
</script>
<div class="main_right">

<div class="zhsz_title">
<a href="edit_fullinfo.php">基本资料</a><a href="edit_baseinfo.php">密码修改</a><a href="edit_face.php" class="cur">头像设置</a><a href="certification.php" >实名认证</a>
</div>
<div class="txsz">

<form action="edit_face.php" method="post" enctype="multipart/form-data" name="form1">
    <input type="hidden" name="dopost" value="save" />
    <input type="hidden" name='oldface' value='<?php echo $face; ?>' />
    <input type="hidden" name='face' id='oldface' value='<?php echo $face; ?>' />
      <div id="mainCp">
         <?php
          if(defined('UC_API') && @include_once DEDEROOT.'/uc_client/client.php')
          {
            $data = uc_get_user($cfg_ml->M_LoginID);
            echo uc_avatar($data[0]);
          }
          else
          {
          ?>
        <div class="postForm edit-full">
        	<div class="title-edit-f">当前我的头像：<h1>如果您还没有设置自己的头像，系统会显示默认头像，您需要上传一张新照片来作为自己的个人头像</h1></div>
            <div id='faceview' class='overflow mTB10 litPic'>
                 <?php
       					if($face!='') echo " <img id='img_path' class='face-1' src='$face' /><img id='img_path1' src='$face' class='face-2' />\r\n";
       			?>
            </div>
            <div class="title-edit-f">设置我的新头像：<h1>选择一个新照片上传编辑，上传之前请<a href="edit_face.php?dopost=delold&oldface=<?php echo urlencode($face); ?>">[删除旧头像]</a></h1></div>
            <div class="modify-area"> 
              <div class="mag">
                <div id="upload-container"> 
                  <button id="upload_button" type="button"><a id="upload-avatar" class="upload-button" href="#"></a></button>
                </div> 
                <div id="loadimg">
                   <img src="<?php echo $cfg_cmsurl; ?>/images/loadinglit.gif" /><p>上传中，请稍候...</p>
                </div>
              </div>
            </div>
            <input class="submit_button" value="保存更新" type="submit">
    </div>
    <?php } ?>
 </div>
</form>

</div>
</div>

</div>

<!--footer-->
<?php include(DEDEMEMBER. "/templets/footer.htm"); ?>
<script type="text/javascript">
$(document).ready(function(){
    ajaxUpload(
		'upload_button',
        2048, 
        'upface/upload.php?form_name=userfile&file_size=2048&type=face&mid=<?php echo $cfg_ml->M_ID;?>',
        'userfile',
        "$(\"#img_path\").attr('src', obj.filename);$(\"#myface\").attr('src', obj.filename);$(\"#img_path1\").attr('src', obj.filename);$(\"#oldface\").attr('value', obj.filename);$(\"#is_upload\").val('1');",
        'loadimg' 
    );
});
</script>
<script type="text/javascript" src="templets/js/upface.js"></script>
<script>
	//会员升级
	var typeid = document.querySelector('#typeid');
	var divs = document.querySelectorAll('.hysj_jiage li div');
	for(var i=0,len=divs.length;i<len;i++){
		divs[i].onclick = divCLickHandler;
	}
	function divCLickHandler(e){
		for(var i=0,len=divs.length;i<len;i++){
			divs[i].className = '';
		}
		this.className = 'cur';
		typeid.value = this.getAttribute('_typeid');
	}
</script>
<script>
	//左边导航
	var as = document.querySelectorAll('.left_menu a');
	var spans = document.querySelectorAll('.left_menu .icons');
	for(var i=0,len=as.length;i<len;i++){
		
		spans[i].clazz = spans[i].className;
		as[i].index = i;
		as[i].onmouseenter = mouseenterHandler;
		as[i].onmouseleave = mouseleaseHandler;
	}
	function mouseleaseHandler(e){
		spans[this.index].className = spans[this.index].clazz;
	}
	
	//左右等高布局
	var main_left = document.querySelector('.main_left');
	var main_right = document.querySelector('.main_right');
	if(main_left.offsetHeight<main_right.offsetHeight){
		main_left.style.height = main_right.offsetHeight + 'px';
	}
</script>

</body>
</html>